<html>
<head>
<title>Consultando Pizzas</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<?
  include "conexao.php" ;
  $conec ;
  $bco ;
  
  $selec = $_POST['rbselec'] ;
  $codigo = $_POST['txcod'] ;

  include "cabecalho.php" ;
	if ($selec == "todas") {

	  $stgsql = $conec->prepare("select *
							   from pizzas
							   order by codigo");  
	  $stgsql->execute();
	  
	  if ($stgsql->rowCount() > 0){
	    include "selecionatodaspizza.php" ;
	  } else {
	    include "erroconsultapizza.php" ;
	  }
	} else {

	  $stgsql = $conec->prepare("select *
                   from pizzas
                   where codigo=\"$codigo\"");  
	  $stgsql->execute();
	  
	  if ($stgsql->rowCount() > 0){
	    include "selecionaumapizza.php" ;
	  } else {
	    include "erroconsultapizza02.php" ;
      }	
	}
	  
			
    include "rodape.php" ;

?>
</body>
</html>
